<template>
  <div>
    <div class="contanier border_top">
      <div class="nav flex align-center">
        <div
          v-for="(item, index) in navList"
          :key="index"
          class="flex align-center"
          :class="nav_act == index ? 'active' : ''"
          v-on:mousemove="navhover(index)"
          @mouseleave="mouseLeave"
          @click="navclcik(index, item.path)"
        >{{ item.text }}</div>
        <span class="morex">[查看更多]</span>
      </div>
      <div class="flex zxfw">
        <div class="flex flex-column align-center">
          <img src="../../../assets/img/教育.png" alt />
          <span>需求定制</span>
        </div>
        <div class="flex flex-column align-center">
          <img src="../../../assets/img/教育.png" alt />
          <span>信息变更</span>
        </div>
        <div class="flex flex-column align-center">
          <img src="../../../assets/img/教育.png" alt />
          <span>业务系统</span>
        </div>
        <div class="flex flex-column align-center">
          <img src="../../../assets/img/教育.png" alt />
          <span>企业服务</span>
        </div>
      </div>
    </div>
    <Supply></Supply>
  </div>
</template>

<script>
import Supply from "./supply";
export default {
  name: "indexProduct",
  components: {
    Supply,
  },
  data() {
    return {
      navList: [
        {
          path: "/",
          text: "在线服务",
        },
      ],
      nav_act: 0,
      hea_act: 0,
    };
  },
  methods: {
    mouseLeave() {
      this.nav_act = this.hea_act;
    },
    navclcik(index, path) {
      this.nav_act = index;
      this.hea_act = index;
      this.$router.push({
        //核心语句
        path: path,
      });
    },
    navhover(data) {
      this.nav_act = data;
    },
  },
};
</script>

<style lang="stylus" scoped>
.contanier {
  width: 588px;
  height: 180px;
  background: #FFFFFF;
  box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
}

.nav {
  position: relative;
}

.nav>div {
  height: 40px;
  font-size: 16px;
  font-weight: 400;
  color: #BF242A;
  padding: 0 20px;
  cursor: pointer;
}

.nav>div.active {
  color: #ffffff;
  border-color: #ffffff;
  background: #EB424C;
  // border-image: -webkit-linear-gradient(to right, #00036B, #409EFF) 30 30;
  // border-image: -moz-linear-gradient(to right, #00036B, #409EFF) 30 30;
  // border-image: linear-gradient(to right, #00036B, #409EFF) 30 30;
}

.morex {
  display: inline-block;
  font-size: 14px;
  color: #666666;
  position: absolute;
  right: 12px;
  cursor: pointer;
}

.zxfw {
  div {
    margin-left: 26px;
    margin-top: 14px;

    img {
      border: 1px dotted #666;
    }

    span {
      color: #323131;
      font-size: 14px;
      margin-top: 8px;
    }
  }
}
</style>
